package org.mtmi.ui.links;

import org.mtmi.ui.IAdaptable;
import org.mtmi.ui.controls.IValueGenerator;


/**
 * Some control may be the source of a link, some other may be the target of a link,
 * few are both.
 * A connection is identified by an id (a String).
 * <p>
 * Extends IAdaptable because when connecting, source or target may adapt to a particular
 * interface (for example: {@link IValueGenerator})
 */
public interface IConnectable extends IAdaptable
{

	/** 
	 * @return the ID of connection at given location.<p>
	 * See {@link CID#SEP} to build connection id
	 */
	String getConnectionAt( int x, int y );
	
	/** @return a Connection anchor provider for given connection id */
	IConnectionOutlinePointProvider getConnectionAnchor( String connection_id );
	
	/** @return the link currently connected to connection id */
//TODO:	Link getLink( String connection_id );
	
	/** Connect link to connection id */
//TODO:	void setLink( String connection_id, Link l );
	
}
